From: Andres Lagar-Cavilla Date: Thu, 12 Jan 2012 10:52:30 +0000 (+0000) Subject: x86/mm: Disable paging_prep X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=b0a5091ac9bff84587094af147ade3d354beea0c;p=xen.git x86/mm: Disable paging_prep The only way to page-in a page is now the safe paging_load domctl. (Unless the page was never paged out in the first place) Signed-off-by: Andres Lagar-Cavilla Acked-by: Tim Deegan Committed-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index e37a1fe0f1..6a1cad08bc 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -989,6 +989,10 @@ int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer) /* Allocate a page if the gfn does not have one yet */ if ( !mfn_valid(mfn) ) { + /* If the user did not provide a buffer, we disallow */ + ret = -EINVAL; + if ( unlikely(user_ptr == NULL) ) + goto out; /* Get a free page */ ret = -ENOMEM; page = alloc_domheap_page(p2m->domain, 0);